const { resolve } = require('path')

module.exports = {
  entry: './main.js',
  output: {
    filename: '[name].js',
    path: resolve(__dirname, './dist')
  },
  devtool: 'source-map',
  devServer: {
    contentBase: resolve(__dirname, './dist'),
    host: '0.0.0.0'
  },
  module: {
    rules: [
      {
        test: /\.(png|jpe?g|gif)$/i,
        use: [
          {
            loader: 'file-loader',
            options: {
              outputPath: 'assets/',
              publicPath: ''
            }
          }
        ]
      }
    ]
  }
}